package com.tarena.lbs.business.pojo.param;

import com.baomidou.mybatisplus.annotation.TableName;
import com.tarena.lbs.business.pojo.po.BusinessPO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class BusinessParam implements Serializable {

    @Schema(description = "id",example = "1", required = true)
    private Integer id;

     @Schema(description = "商家名称",example = "美食第一店")
    private String businessName;

//   industryType =(字典) dictItemId;
     @Schema(description = "商家行业类型（字典数据id）",example = "34")
    private Integer industryType;

     @Schema(description = "负责人姓名",example = "张莉莎")
    private String businessHeadName;

     @Schema(description = "负责人电话",example = "18654236854")
    private String businessHeadPhone;

     @Schema(description = "公司地址",example = "荔枝大厦")
    private String companyAddress;

     @Schema(description = "营业执照",example = "string")
    private String businessLicense;

     @Schema(description = "商家简介",example = "开创最好吃的美食")
    private String businessIntroduction;

     @Schema(description = "商家状态 1 2 3 4 5")
    private Integer businessStatus;

     @Schema(description = "审核备注",example = "同意")
    private String auditRemarks;

     @Schema(description = "商家头像")
    private String businessLogo;

    // 添加toPO()方法，用于将BusinessParam转换为BusinessPO
    public BusinessPO toPO() {
        BusinessPO po = new BusinessPO();
        po.setId(this.getId());
        po.setBusinessName(this.getBusinessName());
        po.setIndustryType(this.getIndustryType());
        po.setBusinessHeadName(this.getBusinessHeadName());
        po.setBusinessHeadPhone(this.getBusinessHeadPhone());
        po.setCompanyAddress(this.getCompanyAddress());
        po.setBusinessLicense(this.getBusinessLicense());
        po.setBusinessIntroduction(this.getBusinessIntroduction());
        po.setEntryTime(new Date()); // 设置当前时间作为入驻时间
        po.setBusinessStatus(this.getBusinessStatus() != null ? this.getBusinessStatus() : 1); // 设置默认状态为1
        po.setAuditRemarks(this.getAuditRemarks());
        po.setBusinessLogo(this.getBusinessLogo());
        return po;
    }
}
